<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:p="http://primefaces.org/ui" 
      xmlns:h="http://java.sun.com/jsf/html">
    <h:head>
        <title>Provisioning: User Profile</title>
    </h:head>
    <h:body>
        <div style="width: 100%; text-align: center;">
            <h:panelGroup rendered="#{userSessionBean.loggedIn}" style="display:inline-block;">
                <p:panel header="Update User Information" style="width:380px;">
                    <h:form>
                        <h:panelGrid columns="2" style="text-align: right;" cellspacing="4">
                            <h:outputText value="Login"/> <h:inputText value="#{userSessionBean.user.login}" readonly="true"/>
                            <h:outputText value="Password"/> <h:inputSecret value="#{userSessionBean.user.password}"/>
                            <h:outputText value="Full Name"/> <h:inputText value="#{userSessionBean.user.fullName}"/>
                            <h:button outcome="welcome?faces-redirect=true" value="To Dashboard"/> <h:commandButton action="#{userSessionBean.user.saveToDB()}" value="Apply"/>
                        </h:panelGrid>
                    </h:form>
                </p:panel>
            </h:panelGroup>
            <h:panelGroup rendered="#{!userSessionBean.loggedIn}">
                You are not authorized. Please, <h:link outcome="login?faces-redirect=true" value="sign in"/>
            </h:panelGroup>
        </div>
    </h:body>
</html>
